package communication;

import java.io.IOException;
import java.io.InputStream;

public class SerialReader extends Thread
    {
		private final int MESSAGELENGTH = 10;
        InputStream in;
        
        public SerialReader ( InputStream in )
        {
            this.in = in;
        }
        
        public int[] read() {
        	
			try {
				int[] message = new int[MESSAGELENGTH];
				int i = 0;
				while (i < MESSAGELENGTH) {
					message[i] = in.read();
					i++;
				}
				return message;
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return null;
        }
        
    }